package com.blumov.fastbox.infrastructure.persistence.dataaccess;

import org.hibernate.Criteria;

/**
 * factory of criteria
 * 
 * @see Session#createCriteria(Class)
 * @see Session#createCriteria(Class, String)
 */
public interface CriteriaFactory {

	/**
	 * @param persistentClass
	 * @return aCriteria
	 */
	@SuppressWarnings("unchecked")
	Criteria create(Class persistentClass);

	/**
	 * @param persistentClass
	 * @param alias
	 * @return aCriteria with that alias
	 */
	@SuppressWarnings("unchecked")
	Criteria create(Class persistentClass, String alias);
}
